package com.lykj.lib_base.api

import androidx.annotation.Keep
import io.reactivex.Observable
import okhttp3.RequestBody
import okhttp3.Response
import okhttp3.ResponseBody
import retrofit2.http.*

/**
 * ================================================
 * Retrofit Service API接口定义
 * ================================================
 *
 * @author gosha
 * @date 2022/9/2-16:27
 */
@Keep
interface Api {
    /**
     * 用户登录初始化
     */
    @POST("/apph5/blindbox/user/init")
    fun userInit(): Observable<ResponseBody>

    /**
     * 首页游戏列表
     */
    @GET("/h5/pass/gameList")
    fun obtainGameList(@QueryMap map: HashMap<String, Any>): Observable<ResponseBody>

    /**
     * 首页轮播图
     */
    @GET("/h5/pass/bannerList")
    fun obtainHomeBanner(): Observable<ResponseBody>

    /**
     * 发送验证码
     */
    @GET("/yzm/getCode")
    fun sendVCode(@Query("tel") tel: String): Observable<ResponseBody>

    /**
     * 用户登录/注册
     */
    @POST("/h5/login")
    @FormUrlEncoded
    fun loginOrRegister(@FieldMap param: HashMap<String, Any>): Observable<ResponseBody>

    /**
     * 获取用户信息
     */
    @GET("/h5/user-center/myselfInfo")
    fun obtainUserInfo(): Observable<ResponseBody>

    /**
     * 获取礼包详情
     */
    @POST("/h5/cardInfo")
    fun obtainGiftDetail(@Body body: RequestBody): Observable<ResponseBody>

    /**
     * 申请礼包
     */
    @POST("/h5/applyCard")
    fun applyGiftBag(@Body body: RequestBody): Observable<ResponseBody>

    /**
     * 获取游戏详情
     */
    @POST("/h5/pass/gameDetail")
    @FormUrlEncoded
    fun obtainGameDetail(@FieldMap param: HashMap<String, Any>): Observable<ResponseBody>

    /**
     * 获取交易
     */
    @GET("/h5/part-transaction/h5PageAll")
    fun obtainTrading(@QueryMap map: HashMap<String, Any>): Observable<ResponseBody>

    /**
     * 获取角色购买列表(账号交易)
     */
    @GET("/h5/part-transaction/h5PageAll")
    fun obtainRoleBuy(@QueryMap map: HashMap<String, Any>): Observable<ResponseBody>

    /**
     * 获取售卖详情
     */
    @GET("/h5/part-transaction/details")
    fun obtainSaleDetail(@Query("id") id: String): Observable<ResponseBody>

    /**
     * 购买
     */
    @POST("/h5/part-transaction/appBuy")
    fun buy(@Query("tranId") tranId: String): Observable<ResponseBody>

    /**
     * 我的礼包
     */
    @GET("/h5/user-center/myselfCard")
    fun myGifts(@QueryMap map: HashMap<String, Any>): Observable<ResponseBody>

    /**
     * 下拉游戏
     */
//    @POST("/pulldown/gameList")
    @GET("/daili/game/pulldown")
    fun obtainChooseGame(@Query("name") name: String): Observable<ResponseBody>

    /**
     * 下拉区服
     */
    @GET("/h5/transaction/servicesInfo")
    fun obtainChooseServer(@Query("gameId") id: String): Observable<ResponseBody>

    /**
     * 下拉角色
     */
    @GET("/h5/transaction/rolesInfo")
    fun obtainChooseRole(
        @Query("gameId") gameId: String, @Query("serviceId") serviceId: String
    ): Observable<ResponseBody>

    /**
     * 添加交易
     */
    @POST("/h5/part-transaction/add")
    fun applyTrading(@Body body: RequestBody): Observable<ResponseBody>

    /**
     * 获取我的优惠券列表
     */
    @POST("/h5/coupon-lottery-log/myCoupon")
    @FormUrlEncoded
    fun obtainMyCoupon(@FieldMap param: HashMap<String, Any>): Observable<ResponseBody>

    /**
     * 获取登录后的验证码
     */
    @GET
    fun obtainVCodeAfterLogin(@Url url: String): Observable<ResponseBody>

    /**
     * 支付
     */
    @POST
    fun pay(@Url url: String, @Body body: RequestBody): Observable<ResponseBody>

    /**
     * 下架
     */
    @POST("/h5/part-transaction/soldOut")
    fun offTheShelf(@Query("tranId") tranId: String): Observable<ResponseBody>

    /**
     * 修改交易金额
     */
    @POST
    fun changeAmount(
        @Url url: String, @Query("tranId") tranId: String, @Query("money") money: String
    ): Observable<ResponseBody>

    /**
     * 获取预约轮播图
     */
    @GET
    fun obtainReservationBanner(@Url url: String): Observable<ResponseBody>

    /**
     * 获取预约详情
     */
    @GET
    fun obtainReservationDetail(@Url url: String): Observable<ResponseBody>

    /**
     * 添加预约
     */
    @POST
    fun addReservation(@Url url: String, @Body body: RequestBody): Observable<ResponseBody>


    /**
     * 用户退出登录
     */
    @POST("/h5/logout")
    fun logout(): Observable<ResponseBody>

    /**
     * 获取有奖任务列表
     */
    @GET("/h5/user-center/myTaskList")
    fun obtainAwardTaskList(): Observable<ResponseBody>

    /**
     * 领取任务奖励
     */
    @POST("/h5/user-center/getIntegral/{taskId}")
    fun receiverAwardTask(@Path("taskId") taskId: String): Observable<ResponseBody>

    /**
     * 我的账单
     */
    @POST("/h5/ptb/myPtbLog")
    fun obtainMyBilling(@QueryMap map: HashMap<String, Any>): Observable<ResponseBody>

    /**
     * 获取玩过游戏
     */
    @GET("/h5/user-center/playedGameList")
    fun obtainPlayedGames(@QueryMap map: HashMap<String, Any>): Observable<ResponseBody>

    /**
     * 获取支付串
     */
    @POST("/h5/member/pay/aliInvoking")
    fun pay2(@Body body: RequestBody): Observable<ResponseBody>

    /**
     * 检查更新
     */
    @POST("/appUpgrade/android")
    fun checkUpdate(): Observable<ResponseBody>

    /**
     * 兑换积分明细
     */
    @GET("/h5/user-center/integralExchange/list")
    fun obtainIntegralRecord(@QueryMap map: HashMap<String, Any>): Observable<ResponseBody>


    /**
     * 福利兑换码
     */
    @POST("/h5/member/pay/vipCode")
    fun welfareCodeExchange(
        @QueryMap map: HashMap<String, Any>
    ): Observable<ResponseBody>

    /**
     * 平台币充值
     */
    @POST("/h5/ptb/payPtbApp")
    fun ptbRecharge(@Query("money") money: String): Observable<ResponseBody>

    /**
     * 积分兑换
     */
    @POST("/h5/user-center/integralExchange/{money}")
    fun integralExchange(@Path("money") money: String): Observable<ResponseBody>

    /**
     * 平台币充值记录列表
     */
    @POST("/h5/ptb/myPtbOrder")
    fun obtainPtbRechargeRecord(@QueryMap map: HashMap<String, Any>): Observable<ResponseBody>

    /**
     * 获取首页
     */
    @GET("/h5/pass/index/gameListAll")
    fun obtainHome(): Observable<ResponseBody>


    /**
     * 获取回收小号列表
     */
    @POST("/h5/part-recycle/recoverablePart")
    fun obtainRecyclingList(): Observable<ResponseBody>


    /**
     * 回收角色
     */
    @POST("/h5/part-recycle/add")
    fun recyclingRole(@Query("partId") partId: String): Observable<ResponseBody>

    /**
     * 回收记录
     */
    @POST("/h5/part-recycle/myPartRecycle")
    fun recyclingRecords(@QueryMap map: HashMap<String, Any>): Observable<ResponseBody>

    /**
     * 购买记录
     */
    @GET("/h5/part-transaction/myPageAll")
    fun buyOrSaleRecords(@QueryMap map: HashMap<String, Any>): Observable<ResponseBody>

    /**
     * 获取首页会员游戏
     */
    @GET("/h5/pass/vipGameList")
    fun obtainHomeVipGames(): Observable<ResponseBody>

    /**
     * 获取可售卖的角色
     */
    @POST("/h5/part-transaction/myRoles")
    fun obtainSaleRole(): Observable<ResponseBody>

    /**
     * 修改头像或昵称
     */
    @POST("/h5/user-center/editMyInfo")
    @FormUrlEncoded
    fun editUserInfo(@FieldMap map: HashMap<String, Any>): Observable<ResponseBody>

    /**
     * 实名认证
     */
    @POST("/h5/user-center/realNameAuth")
    fun realNameAuth(@QueryMap map: HashMap<String, Any>): Observable<ResponseBody>

    /**
     * 检查服务商代码
     */
    @POST("/daili/cpsuser/checkShareCode")
    fun checkCode(@Query("shareCode") shareCode: String): Observable<ResponseBody>

    /**
     * 代理登录
     */
    @Headers("isAgent:1")
    @POST("/daili/cpsuser/login")
    fun agentLogin(@Body body: RequestBody): Observable<ResponseBody>

    /**
     * 获取代理用户信息
     */
    @Headers("isAgent:1")
    @POST("/daili/cpsuser/userInfo")
    fun obtainAgentInfo(): Observable<ResponseBody>

    /**
     * 获取分享链接
     */
    @Headers("isAgent:1")
    @POST("/daili/game/shareLink")
    fun obtainShareLink(@Query("gameId") gameId: String): Observable<ResponseBody>

    /**
     * 发起提现申请
     */
    @Headers("isAgent:1")
    @POST("/daili/cpsCash/add")
    fun withdrawApply(@Body body: RequestBody): Observable<ResponseBody>

    /**
     * 获取提现记录
     */
    @Headers("isAgent:1")
    @POST("/daili/cpsCash/pageAll")
    fun obtainWithdrawalRecord(@QueryMap map: HashMap<String, Any>): Observable<ResponseBody>

    /**
     * 修改代理用户信息
     */
    @Headers("isAgent:1")
    @POST("/daili/cpsuser/editUserInfo")
    fun editAgentUserInfo(@QueryMap map: HashMap<String, Any>): Observable<ResponseBody>

    /**
     * 可购买代金券
     */
    @Headers("isAgent:1")
    @GET("/daili/coupon/payCouponInfo")
    fun obtainCanBuyVoucher(@QueryMap map: HashMap<String, Any>): Observable<ResponseBody>


    /**
     * 我的代金券
     */
    @Headers("isAgent:1")
    @POST("/daili/coupon/myCoupon")
    fun obtainMyVoucher(@QueryMap map: HashMap<String, Any>): Observable<ResponseBody>

    /**
     * 余额购买
     */
    @Headers("isAgent:1")
    @POST("/daili/coupon/pay")
    fun balanceBuy(@Query("infoId") infoId: String): Observable<ResponseBody>

    /**
     * 支付宝购买
     */
    @Headers("isAgent:1")
    @POST("/daili/coupon/zfbPay")
    fun zfbBuy(@Query("infoId") infoId: String): Observable<ResponseBody>

    /**
     * 代金券赠送
     */
    @Headers("isAgent:1")
    @POST("/daili/coupon/addCouponLog")
    fun voucherGift(@Body body: RequestBody): Observable<ResponseBody>

    /**
     * 获取代理实时数据
     */
    @Headers("isAgent:1")
    @POST("/daili/cpsuser/oneHourOrder")
    fun obtainRTData(): Observable<ResponseBody>

    /**
     * 获取游戏攻略列表
     */
    @GET("/h5/pass/gameNoticeList")
    fun obtainGameActivity(@Query("gameId") gameId: String): Observable<ResponseBody>

    /**
     * 获取游戏攻略详情
     */
    @GET("/h5/pass/gameNoticeInfo/{id}")
    fun obtainActivityDetail(@Path("id") id: String): Observable<ResponseBody>


    /**
     * 获取apk下载地址
     */
    @GET
    fun obtainDownloadUrl(@Url url: String): Observable<ResponseBody>

    /**
     * 获取收益记录
     */
    @Headers("isAgent:1")
    @POST("/daili/cpsCash/syPageAll")
    fun obtainEarningRecord(@QueryMap map: HashMap<String, Any>): Observable<ResponseBody>

    /**
     * 游戏收藏
     */
    @POST("/h5/user-center/game/scAndDzOrCancel")
    fun collectGame(@QueryMap map: HashMap<String, Any>): Observable<ResponseBody>

    /**
     * 搜索游戏
     */
    @GET("/h5/pass/searchGame")
    fun searchGame(@Query("gamename") gameName: String): Observable<ResponseBody>

    /**
     * 获取搜索推荐
     */
    @GET("/h5/pass/searchPageGame")
    fun obtainSearchRecommend(): Observable<ResponseBody>

    /**
     * 获取分享的收益相关信息
     */
    @GET("/h5/userShareInfo")
    fun obtainShareInfo(): Observable<ResponseBody>

    /**
     * 修改代理头像或昵称
     */
    @Headers("isAgent:1")
    @POST("/daili/cpsuser/editUserInfo")
    @FormUrlEncoded
    fun editAgentAvatarNickName(@FieldMap map: HashMap<String, Any>): Observable<ResponseBody>

    /**
     * 微信认证
     */
    @POST("/h5/user-center/task/wxClick/{taskId}")
    fun bindWx(@Path("taskId") taskId: String): Observable<ResponseBody>

    /**
     * 获取游戏评论
     */
    @GET("h5/pass/gameCommentList")
    fun obtainGameComments(@Query("gameId") gameId: String): Observable<ResponseBody>

    /**
     * 获取我的收藏
     */
    @GET("/h5/user-center/game/collectList")
    fun obtainMyCollect(): Observable<ResponseBody>

    /**
     * 获取更多热门
     */
    @GET("/h5/pass/hotGamePage")
    fun obtainHotGameLookMore(@QueryMap map: HashMap<String, Any>): Observable<ResponseBody>

    /**
     * 获取游戏优惠券列表
     */
    @GET("/h5/coupon/getCouponsByGameId")
    fun obtainGameCoupons(@Query("gameId") gameId: String): Observable<ResponseBody>

    /**
     * 领取游戏优惠券
     */
    @POST("/h5/coupon/getCouponLog")
    fun receiverGameCoupon(@Query("couponId") couponId: String): Observable<ResponseBody>

    /**
     * 获取VIP礼包详情
     */
    @GET("/h5/pass/vipGame/card/{gameId}")
    fun obtainVipGiftBagDetail(@Path("gameId") gameId: String):Observable<ResponseBody>

    /**
     * 申请会员礼包
     */
    @POST("/h5/vipGame/cardApply")
    fun applyVipGiftBag(@Body body: RequestBody):Observable<ResponseBody>

    /**
     * 获取服务端配置
     */
    @GET("/h5/dealIsShow")
    fun obtainServerConfig():Observable<ResponseBody>
}